<?php
require_once 'BaseMySQLDAO.php';

class GameCategoryDAO extends BaseMySQLDAO {

    public function __construct($context) {
        parent::__construct($context, 'game_category');
    }

	public function countGameCategoryByParentTPG($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent = :parent ORDER BY `order` ASC";
            $param = array(":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByParentMobile($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent = :parent ORDER BY `order` ASC";
            $param = array(":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByParentCGMB($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent = :parent ORDER BY `order` ASC";
            $param = array(":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByParentMMBG($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent = :parent ORDER BY `order` ASC";
            $param = array(":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByParentNSGT($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent = :parent ORDER BY `order` ASC";
            $param = array(":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];;
    }
    
    public function getGameCategoryByParentTPG($start, $limit, $parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           				LIMIT :start, :limit 
           			";
            
            $param = array(':start' => $start, ':limit' => $limit, ":parent" => $parent);
          
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByParentMobile($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           			";
            
            $param = array(":parent" => $parent);
          
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByParentMMBG1($parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           			";
            
            $param = array(":parent" => $parent);
          
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    	
    public function getGameCategoryByParentCGMB($start, $limit, $parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           				LIMIT :start, :limit 
           			";
            
            $param = array(':start' => $start, ':limit' => $limit, ":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByParentMMBG($start, $limit, $parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           				LIMIT :start, :limit 
           			";
            
            $param = array(':start' => $start, ':limit' => $limit, ":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
 	public function getGameCategoryByParentNSGT($start, $limit, $parent) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "	SELECT * 
           				FROM game_category 
           				WHERE parent = :parent 
           				ORDER BY `order` ASC
           				LIMIT :start, :limit 
           			";
            
            $param = array(':start' => $start, ':limit' => $limit, ":parent" => $parent);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function countGameCategoryTPG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent != 0  ORDER BY `name` ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryMobile() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent != 0  ORDER BY `name` ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent != 0  ORDER BY `name` ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent != 0  ORDER BY `name` ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE parent != 0  ORDER BY `name` ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
    public function getFullGameCategoryNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategory() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction();

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryTPG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryMobile() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `name` ASC  ";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryByLimitTPG($start, $limit) {
        $result = array();
        try {
        	
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `id` DESC 
            			LIMIT :start, :limit ";
            
            $param = array(':start' => $start, ':limit' => $limit);
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL,$param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryByLimitMobile($start, $limit) {
        $result = array();
        try {
        	
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `id` DESC 
            			LIMIT :start, :limit ";
            
            $param = array(':start' => $start, ':limit' => $limit);
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL,$param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryByLimitCGMB($start, $limit) {
        $result = array();
        try {
        	
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `id` DESC 
            			LIMIT :start, :limit ";
            
            $param = array(':start' => $start, ':limit' => $limit);
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL,$param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryByLimitNSGT($start, $limit) {
        $result = array();
        try {
        	
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `id` DESC  
            			LIMIT :start, :limit ";
            
            $param = array(':start' => $start, ':limit' => $limit);
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL,$param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getFullGameCategoryByLimitMMBG($start, $limit) {
        $result = array();
        try {
        	
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "	SELECT * 
            			FROM game_category 
            			WHERE parent != 0  
            			ORDER BY `id` DESC 
            			LIMIT :start, :limit ";
            
            $param = array(':start' => $start, ':limit' => $limit);
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL,$param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }

    public function getGameCategoryByIDTPG($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByNameTPG($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByNameMobile($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIDMobile($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIDCGMB($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIDMMBG($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIDNSGT($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByNameCGMB($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByNameMMBG($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByNameNSGT($id) {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE id = :id";
            $param = array(":id" => $id);
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL, $param);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsNewCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT * FROM game_category WHERE isNew > 0 ORDER BY isNew ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsNewMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE isNew > 0 ORDER BY isNew ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsNewNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE isNew > 0 ORDER BY isNew ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsPopCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT * FROM game_category WHERE isPop > 0 ORDER BY isPop ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsPopMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE isPop > 0 ORDER BY isPop ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsPopNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE isPop > 0  ORDER BY isPop ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByRankNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE rank > 0  ORDER BY rank ASC";
            
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByRankCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT * FROM game_category WHERE rank > 0  ORDER BY rank ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByRankMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE rank > 0  ORDER BY rank ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsFavoriteMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT * FROM game_category WHERE isFavorite > 0  ORDER BY isFavorite ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function getGameCategoryByIsFavoriteNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT * FROM game_category WHERE isFavorite > 0  ORDER BY isFavorite ASC";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadManyRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result;
    }
    
	public function countGameCategoryByIsNewCGMB() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE isNew > 0";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByIsNewMMBG() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE isNew > 0";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function countGameCategoryByIsNewNSGT() {
        $result = array();
        try {
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');

            $inSQL = "SELECT count(id) as total FROM game_category WHERE isNew > 0";
            $result = $this -> getContext() -> getTransaction() -> getMySQLConnection() -> loadOneRow($inSQL);

            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
        }
        return $result['total'];
    }
    
	public function insertGameCategoryMMBGAndNSGT($param) {
        $result = null;
        try {
            $inSQL = "INSERT INTO
                        game_category(id, name, unique_name, smallImage, mediumImage, largeImage, xlargeImage, parent, SEO_metaDescription, SEO_keyword, status, hot_star, isFavorite, isNew, isPop, rank)
                        VALUES (
                            :id, :name, :unique_name, :smallImage, :mediumImage, :largeImage, :xlargeImage, :parent, :SEO_metaDescription, :SEO_keyword, :status, :hot_star, :isFavorite, :isNew, :isPop, :rank 
                        )";
            $queryParam = array(
                                ':id' => NULL,
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
                                ':hot_star' => $param['hot_star'],
            					':status' =>1,
                                ':isFavorite' => $param['isFavorite'],
                                ':isNew' => $param['isNew'],
                                ':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
         
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();
            
        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function insertGameCategoryMMBG($param) {
        $result = null;
        try {
            $inSQL = "INSERT INTO
                        game_category(id, name, unique_name, smallImage, mediumImage, largeImage, xlargeImage, parent, SEO_metaDescription, SEO_keyword, linkMWork, status, hot_star, isFavorite, isNew, isPop, rank)
                        VALUES (
                            :id, :name, :unique_name, :smallImage, :mediumImage, :largeImage, :xlargeImage, :parent, :SEO_metaDescription, :SEO_keyword, :linkMWork, :status, :hot_star, :isFavorite, :isNew, :isPop, :rank 
                        )";
            $queryParam = array(
                                ':id' => NULL,
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':linkMWork' => $param['linkMWork'],
                                ':hot_star' => $param['hot_star'],
            					':status' =>1,
                                ':isFavorite' => $param['isFavorite'],
                                ':isNew' => $param['isNew'],
                                ':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
         
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();
            

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function insertGameCategoryTPG($param) {
        $result = null;
        try {
            $inSQL = "INSERT INTO
                        game_category(id, name, unique_name, smallImage, mediumImage, largeImage, parent, SEO_metaDescription, SEO_keyword, linkMWork, status, hot_star, isFavorite, isNew, isPop, rank)
                        VALUES (
                            :id, :name, :unique_name, :smallImage, :mediumImage, :largeImage, :parent, :SEO_metaDescription, :SEO_keyword, :linkMWork, :status, :hot_star, :isFavorite, :isNew, :isPop, :rank 
                        )";
            $queryParam = array(
                                ':id' => NULL,
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':linkMWork' => $param['linkMWork'],
            					':status' => 1,
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
                                ':isNew' => $param['isNew'],
                                ':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
			
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();
            
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function insertGameCategoryMobile($param) {
        $result = null;
        try {
            $inSQL = "INSERT INTO
                        game_category(id, name, unique_name, smallImage, mediumImage, largeImage, parent, SEO_metaDescription, SEO_keyword, linkMWork, status, hot_star, isFavorite, isNew, isPop, rank)
                        VALUES (
                            :id, :name, :unique_name, :smallImage, :mediumImage, :largeImage, :parent, :SEO_metaDescription, :SEO_keyword, :linkMWork, :status, :hot_star, :isFavorite, :isNew, :isPop, :rank 
                        )";
            $queryParam = array(
                                ':id' => NULL,
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':linkMWork' => $param['linkMWork'],
            					':status' => 1,
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
                                ':isNew' => $param['isNew'],
                                ':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function insertGameCategoryCGMB($param) {
        $result = null;
        try {
            $inSQL = "INSERT INTO
                        game_category(id, name, unique_name, smallImage, mediumImage, largeImage, xlargeImage, parent, SEO_metaDescription, SEO_keyword, status, hot_star, isNew, isPop, rank)
                        VALUES (
                            :id, :name, :unique_name, :smallImage, :mediumImage, :largeImage, :xlargeImage, :parent, :SEO_metaDescription, :SEO_keyword, :status, :hot_star, :isNew, :isPop, :rank 
                        )";
            $queryParam = array(
                                ':id' => NULL,
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => 1,
                                ':hot_star' => $param['hot_star'],
                                ':isNew' => $param['isNew'],
                                ':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );

            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();
            
        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryTPG($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
                                name = :name,
                                unique_name = :unique_name,
                                smallImage = :smallImage,
                                mediumImage = :mediumImage,
                                largeImage = :largeImage,
                                shortDetail = :shortDetail,
                                parent = :parent,
                                SEO_metaDescription = :SEO_metaDescription,
                                SEO_keyword = :SEO_keyword,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':shortDetail' => $param['shortDetail'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
			
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryMobile($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
                                name = :name,
                                unique_name = :unique_name,
                                smallImage = :smallImage,
                                mediumImage = :mediumImage,
                                largeImage = :largeImage,
                                shortDetail = :shortDetail,
                                parent = :parent,
                                SEO_metaDescription = :SEO_metaDescription,
                                SEO_keyword = :SEO_keyword,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':shortDetail' => $param['shortDetail'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
			
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryAjaxTPG($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
            					name = :name,
                                unique_name = :unique_name,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isFavorite = :isFavorite,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank,
                                about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
            					':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
			
            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryAjaxMobile($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
            					name = :name,
                                unique_name = :unique_name,
                                shortDetail = :shortDetail,
                                SEO_metaDescription	= :SEO_metaDescription,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                 about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
            					':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
					            ':shortDetail' => $param['shortDetail'],
					            ':SEO_metaDescription' => $param['SEO_metaDescription'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
			
            $this -> getContext() -> getTransaction() -> startTransaction('mobile');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryCGMB($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
                                name = :name,
                                unique_name = :unique_name,
                                smallImage = :smallImage,
                                mediumImage = :mediumImage,
                                largeImage = :largeImage,
                                xlargeImage = :xlargeImage,
                                shortDetail = :shortDetail,
                                parent = :parent,
                                SEO_metaDescription = :SEO_metaDescription,
                                SEO_keyword = :SEO_keyword,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
            					':shortDetail' => $param['shortDetail'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryAjaxCGMB($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
            					name = :name,
                                unique_name = :unique_name,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
            					':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryMMBG($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
                                name = :name,
                                unique_name = :unique_name,
                                smallImage = :smallImage,
                                mediumImage = :mediumImage,
                                largeImage = :largeImage,
                                xlargeImage = :xlargeImage,
                                shortDetail = :shortDetail,
                                parent = :parent,
                                SEO_metaDescription = :SEO_metaDescription,
                                SEO_keyword = :SEO_keyword,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isFavorite = :isFavorite,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank,
                                about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
            					':shortDetail' => $param['shortDetail'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryAjaxMMBG($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
            					name = :name,
                                unique_name = :unique_name,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isFavorite = :isFavorite,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank,
                                about_link = :about_link,
                                update_link = :update_link
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
            					':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank'],
            					':about_link' => $param['about_link'],
            					':update_link' => $param['update_link']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryAjaxNSGT($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
            					name = :name,
                                unique_name = :unique_name,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isFavorite = :isFavorite,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
            					':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function updateGameCategoryNSGT($param) {
        $result = null;
        try {
            $inSQL = "UPDATE game_category SET
                                name = :name,
                                unique_name = :unique_name,
                                smallImage = :smallImage,
                                mediumImage = :mediumImage,
                                largeImage = :largeImage,
                                xlargeImage = :xlargeImage,
                                shortDetail = :shortDetail,
                                parent = :parent,
                                SEO_metaDescription = :SEO_metaDescription,
                                SEO_keyword = :SEO_keyword,
            					status = :status,
            					`order` = :order,
                                hot_star = :hot_star,
                                isFavorite = :isFavorite,
                                isNew = :isNew,
                                isPop = :isPop,
                                rank = :rank
                        Where id = :id
                        ";
            $queryParam = array(
            					':id' => $param['id'],
                                ':name' => $param['name'],
            					':unique_name' => $param['unique_name'],
                                ':smallImage' => $param['smallImage'],
                                ':mediumImage' => $param['mediumImage'],
                                ':largeImage' => $param['largeImage'],
            					':xlargeImage' => $param['xlargeImage'],
            					':shortDetail' => $param['shortDetail'],
                                ':parent' => $param['parent'],
                                ':SEO_metaDescription' => $param['SEO_metaDescription'],
                                ':SEO_keyword' => $param['SEO_keyword'],
            					':status' => $param['status'],
            					':order' => $param['order'],
                                ':hot_star' => $param['hot_star'],
            					':isFavorite' => $param['isFavorite'],
            					':isNew' => $param['isNew'],
            					':isPop' => $param['isPop'],
            					':rank' => $param['rank']
                            );
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $queryParam);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            print_r($exception);
            exit;
        }
        return $result;
    }
    
	public function deleteGameCategoryTPG($id) {
        try {

            $inSQL = "   DELETE FROM game_category WHERE id = :id ";
            $param = array(':id' => $id);

            $this -> getContext() -> getTransaction() -> startTransaction('thanhphogame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $param);
            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
            return false;
        }
        return true;
    }
    
	public function deleteGameCategoryCGMB($id) {
        try {

            $inSQL = "   DELETE FROM game_category WHERE id = :id ";
            $param = array(':id' => $id);
            
            $this -> getContext() -> getTransaction() -> startTransaction('choigamemobi');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $param);
            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
            return false;
        }
        return true;
    }
    
	public function deleteGameCategoryMMBG($id) {
        try {

            $inSQL = "   DELETE FROM game_category WHERE id = :id ";
            $param = array(':id' => $id);
            $this -> getContext() -> getTransaction() -> startTransaction('mymobigame');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $param);
            $this -> getContext() -> getTransaction() -> closeTransaction();
        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
            return false;
        }
        return true;
    }
    
	public function deleteGameCategoryNSGT($id) {
        try {

            $inSQL = "   DELETE FROM game_category WHERE id = :id ";
            $param = array(':id' => $id);
            $this -> getContext() -> getTransaction() -> startTransaction('ngoisaogamethu');
            $this -> getContext() -> getTransaction() -> getMySQLConnection() -> executeNonQuery($inSQL, $param);
            $this -> getContext() -> getTransaction() -> closeTransaction();

        } catch (Exception $exception) {
            $this -> getContext() -> logException($exception);
            return false;
        }
        return true;
    }

}
?>